//
//  AllQuestionViewController.m
//  SmartWatch
//
//  Created by zwj on 2022/11/22.
//

@interface QuestionTableCell : UITableViewCell

@end

@implementation QuestionTableCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    if(self == [super initWithStyle: style reuseIdentifier:reuseIdentifier]){
        
        MyLinearLayout *root = [MyLinearLayout linearLayoutWithOrientation:MyOrientation_Horz];
        root.myWidth = kScreenWidth;
        root.cacheEstimatedRect = YES;
        root.heightSize.equalTo(root.heightSize).min(48);
        root.gravity = MyGravity_Vert_Center;
        root.padding = UIEdgeInsetsMake(0, 15, 0, 15);
        root.subviewHSpace = 10;
        [self.contentView addSubview:root];
        
        UIView *dian = UIView.new;
        dian.mySize = CGSizeMake(6, 6);
        dian.backgroundColor = THEME_COLOR;
        ViewCorner(dian, 3);
        [root addSubview:dian];
        
        UILabel *name = [UILabel createLabelText:@"在配对时无法找到手表？" font:UIFontMake(15) textColor:COLOR1515];
        name.weight = 1;
        name.myHeight = kAutoHeight;
        [root addSubview:name];
        
        UIImageView *right = [[UIImageView alloc]initWithImage:UIImageMake(@"icon_arrow_right")];
        right.mySize = CGSizeMake(16, 16);
        [root addSubview:right];
        
    }
    return self;
}



@end

#import "AllQuestionViewController.h"

@interface AllQuestionViewController ()<QMUITableViewDataSource,QMUITableViewDelegate>
@property(nonatomic,strong) QMUITableView *tableView;

@end

@implementation AllQuestionViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"常见问题";
    self.view.backgroundColor = BACKGROUNDCOLOR;
}

- (void)initSubviews {
    [super initSubviews];
    
    self.tableView = [[QMUITableView alloc]initWithFrame:CGRectMake(0, NavigationContentTop + 15, kScreenWidth, kScreenHeight - NavigationContentTop - 15)];
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.backgroundColor = BACKGROUNDCOLOR;
    [self.tableView registerClass:[QuestionTableCell class] forCellReuseIdentifier:@"QuestionTableCell"];
    self.tableView.showsVerticalScrollIndicator = false;
    self.tableView.bounces = false;
    [self.view addSubview:self.tableView];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    QuestionTableCell *cell = [tableView dequeueReusableCellWithIdentifier:@"QuestionTableCell" forIndexPath:indexPath];
    
    
    
    return  cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
}

@end
